﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Assignment3.Objects3D;

namespace Assignment3
{
    enum CollisionType { None, Wall, Boundary, Enemy, Target }

    class CollisionHandler
    {
        /// <summary>
        /// Check in case isWallPenetrate ==false
        /// </summary>
        /// <param name="cameraSphere">BoundingSphere of the character</param>
        /// <param name="walls">List of walls</param>
        /// <returns>CollisionType.Wall if wall is hit, Collsion.None if nothing hit</returns>
        public static CollisionType CheckColission(BoundingSphere character,ref List<WallBlock> walls)
        {
            foreach (WallBlock wall in walls)
                if (wall.WallBorder.Intersects(character))
                {
                    return CollisionType.Wall;
                }
            return CollisionType.None;
        }
    }
}
